package java3;

import java.util.Arrays;
import java.util.Scanner;

public class Main1 {
		public static void main(String[] args) {
			@SuppressWarnings("resource")
			Scanner sc = new Scanner(System.in);
			String choice;
			String[] strDigits;
			int[] digits = null;
			while(sc.hasNextLine()){
			    choice = sc.nextLine();
			    switch (choice) {
				case "fib":
					int n = Integer.parseInt(sc.nextLine());
					fib(n);
					break;
				case "sort":
					String line = sc.nextLine();
					strDigits = line.split(" ");
					digits = convertToIntDigits(strDigits);
				    Arrays.sort(digits);
				    System.out.println(Arrays.toString(digits));
				    break;
				case "search":
					Arrays.sort(digits);
					int digit = Integer.parseInt(sc.nextLine());
					int pos = Arrays.binarySearch(digits, digit);
					if(pos<0)
						System.out.println(-1);
					else
						System.out.println(pos);
					break;
				}
			
			}
		}
			

		private static int[] convertToIntDigits(String[] strDigits) {
			// TODO Auto-generated method stub
			return null;
		}


		private static void fib(int n) {
			System.out.println("i am fib");
			
		}
	}
